package com.pyue.eam.admin.api.entity.regi;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.pyue.eam.admin.api.base.BaseEntity;
import com.pyue.eam.admin.api.dto.SimpleUserInfo;
import com.pyue.eam.admin.api.mate.BindType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
import lombok.experimental.Accessors;
// import mybatis.mate.annotation.FieldBind;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.util.List;

/**
 * 线边任务表
 */
@Data
@TableName("cq_task_lib")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "线边任务表")
@Accessors(chain = true)
public class CqTaskLibEntity extends BaseEntity {

    @TableId(type = IdType.ASSIGN_ID)
    private Long taskId;

    /**
     * 需求人数
     */
    @NotNull(message = "需求人数不能为空")
    @Schema(description = "需求人数")
    private Integer perNum;

    /**
     * 计划开始
     */
    @Schema(description = "计划开始")
    private LocalDate planStart;

    /**
     * 计划结束
     */
    @Schema(description = "计划结束")
    private LocalDate planEnd;

    /**
     * 实际开始
     */
    @Schema(description = "实际开始")
    private LocalDate realStart;

    /**
     * 实际结束
     */
    @Schema(description = "实际结束")
    private LocalDate realEnd;

    /**
     * 工作地址
     */
    @NotBlank(message = "地址不能为空")
    @Schema(description = "地址")
    private String address;

    /**
     * 详细地址
     */
    @NotBlank(message = "地址详情不能为空")
    @Schema(description = "地址详情")
    private String addressDetail;

    /**
     * 客户id
     */
    @NotNull(message = "客户不能为空")
    // @FieldBind(type = "client", target = "clientIdTrans")
    @Schema(description = "客户id")
    private String clientId;

    /**
     * 客户名称
     */
    @TableField(exist = false)
    @Schema(description = "客户名称")
    private String clientIdTrans;

    /**
     * 零件id
     */
    @NotNull(message = "零件不能为空")
    @Schema(description = "零件id")
    private String partId;

    /**
     * 参与职工ids,逗号拼接
     */
    @Schema(description = "参与职工ids,逗号拼接")
    private String workUserIds;

    @Schema(description = "参与职工信息")
    @TableField(exist = false)
    private List<SimpleUserInfo> workUserInfo;

    /**
     * 零件号
     */
    @Schema(description = "零件号")
    @TableField(exist = false)
    private String partCode;

    /**
     * 零件名称
     */
    @Schema(description = "零件名称")
    @TableField(exist = false)
    private String partName;

    /**
     * 预计质检数量
     */
    private Integer planPartNum;

    /**
     * 实际质检数量
     */
    private Integer realPartNum;

    /**
     * 任务状态(dict:task_status_dict, 0发布 2执行中 3待验收 8验收完成 4关闭 9取消)
     */
    // @FieldBind(type = BindType.DICT + "task_status_dict", target = "taskStatusTrans")
    private String taskStatus;

    /**
     * 任务状态(dict:task_status_dict)
     */
    @TableField(exist = false)
    private String taskStatusTrans;

    /**
     * 招工策略：计时,计件,包天(dict:tactics_type)
     */
    // @FieldBind(type = BindType.DICT + "tactics_type", target = "tacticsTrans")
    private String tactics;

    @TableField(exist = false)
    private String tacticsTrans;

    /**
     * 提供工具(dict:sup_tool_dict)
     */
    // @FieldBind(type = BindType.DICT + "sup_tool_dict", target = "supToolTrans")
    private String supTool;

    @TableField(exist = false)
    private String supToolTrans;

    /**
     * 类型(dict:task_part_status)
     */
    // @FieldBind(type = BindType.DICT + "task_part_status", target = "partStatusTrans")
    private String partStatus;

    @TableField(exist = false)
    private String partStatusTrans;

    /**
     * 工时费
     */
    private Double workHour;

    /**
     * 工时长-每件费用｜小时数｜天数
     */
    private Double hourPrice;

    /**
     * 总价格
     */
    private Double countPrice;

    /**
     * 地区预测价格
     */
    private String forecastPrice;

    /**
     * 地区价格区间 400~500
     */
    private String regionPriceRange;

    /**
     * 记时报工总价格
     */
    private Double countWorkerPrice;

    /**
     * 代办消息数量
     */
    @TableField(exist = false)
    private Integer todoCount;

    /**
     * 附件
     */
    @Schema(description = "附件")
    private String fileIds;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 团长id-用户id
     */
    @Schema(description = "团长id")
    private Long regiChargeId;

    /**
     * 接受团id
     */
    @Schema(description = "团id")
    private Long regiId;

    /**
     * 接受方案id
     */
    @Schema(description = "接受方案id")
    private Long taskPlanId;

    /**
     * 公司id
     */
    @Schema(description = "公司id")
    private Long companyId;

    // 接收任务
    @Schema(description = "接收任务")
    @TableField(exist = false)
    private CqTaskAccept cqTaskAccept;

    // 验收任务
    @Schema(description = "验收任务")
    @TableField(exist = false)
    private CqTaskCheck cqTaskCheck;


}
